home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / ldscripts / elf_x86_64.xs < prev    next >
Encoding:
LD Linker Script  |  2009-02-10  |  8.1 KB  |  210 lines

  1. /* Script for ld --shared: link shared library */
  2. OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
  3.           "elf64-x86-64")
  4. OUTPUT_ARCH(i386:x86-64)
  5. ENTRY(_start)
  6. SEARCH_DIR("/usr/i486-linux-gnu/lib64"); SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/x86_64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
  7. SECTIONS
  8. {
  9.   /* Read-only sections, merged into text segment: */
  10.   . = 0 + SIZEOF_HEADERS;
  11.   .note.gnu.build-id : { *(.note.gnu.build-id) }
  12.   .hash           : { *(.hash) }
  13.   .gnu.hash       : { *(.gnu.hash) }
  14.   .dynsym         : { *(.dynsym) }
  15.   .dynstr         : { *(.dynstr) }
  16.   .gnu.version    : { *(.gnu.version) }
  17.   .gnu.version_d  : { *(.gnu.version_d) }
  18.   .gnu.version_r  : { *(.gnu.version_r) }
  19.   .rel.init       : { *(.rel.init) }
  20.   .rela.init      : { *(.rela.init) }
  21.   .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
  22.   .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  23.   .rel.fini       : { *(.rel.fini) }
  24.   .rela.fini      : { *(.rela.fini) }
  25.   .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
  26.   .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  27.   .rel.data.rel.ro   : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
  28.   .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
  29.   .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
  30.   .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  31.   .rel.tdata      : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
  32.   .rela.tdata      : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  33.   .rel.tbss      : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
  34.   .rela.tbss      : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  35.   .rel.ctors      : { *(.rel.ctors) }
  36.   .rela.ctors     : { *(.rela.ctors) }
  37.   .rel.dtors      : { *(.rel.dtors) }
  38.   .rela.dtors     : { *(.rela.dtors) }
  39.   .rel.got        : { *(.rel.got) }
  40.   .rela.got       : { *(.rela.got) }
  41.   .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
  42.   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  43.   .rel.ldata      : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }
  44.   .rela.ldata     : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }
  45.   .rel.lbss       : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }
  46.   .rela.lbss      : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }
  47.   .rel.lrodata    : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }
  48.   .rela.lrodata   : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }
  49.   .rel.plt        : { *(.rel.plt) }
  50.   .rela.plt       : { *(.rela.plt) }
  51.   .init           :
  52.   {
  53.     KEEP (*(.init))
  54.   } =0x90909090
  55.   .plt            : { *(.plt) }
  56.   .text           :
  57.   {
  58.     *(.text .stub .text.* .gnu.linkonce.t.*)
  59.     /* .gnu.warning sections are handled specially by elf32.em.  */
  60.     *(.gnu.warning)
  61.   } =0x90909090
  62.   .fini           :
  63.   {
  64.     KEEP (*(.fini))
  65.   } =0x90909090
  66.   PROVIDE (__etext = .);
  67.   PROVIDE (_etext = .);
  68.   PROVIDE (etext = .);
  69.   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  70.   .rodata1        : { *(.rodata1) }
  71.   .eh_frame_hdr : { *(.eh_frame_hdr) }
  72.   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  73.   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  74.   /* Adjust the address for the data segment.  We want to adjust up to
  75.      the same address within the page on the next page up.  */
  76.   . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  77.   /* Exception handling  */
  78.   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  79.   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  80.   /* Thread Local Storage sections  */
  81.   .tdata      : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  82.   .tbss          : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  83.   .preinit_array     :
  84.   {
  85.     KEEP (*(.preinit_array))
  86.   }
  87.   .init_array     :
  88.   {
  89.      KEEP (*(SORT(.init_array.*)))
  90.      KEEP (*(.init_array))
  91.   }
  92.   .fini_array     :
  93.   {
  94.     KEEP (*(.fini_array))
  95.     KEEP (*(SORT(.fini_array.*)))
  96.   }
  97.   .ctors          :
  98.   {
  99.     /* gcc uses crtbegin.o to find the start of
  100.        the constructors, so we make sure it is
  101.        first.  Because this is a wildcard, it
  102.        doesn't matter if the user does not
  103.        actually link against crtbegin.o; the
  104.        linker won't look for a file to match a
  105.        wildcard.  The wildcard also means that it
  106.        doesn't matter which directory crtbegin.o
  107.        is in.  */
  108.     KEEP (*crtbegin.o(.ctors))
  109.     KEEP (*crtbegin?.o(.ctors))
  110.     /* We don't want to include the .ctor section from
  111.        the crtend.o file until after the sorted ctors.
  112.        The .ctor section from the crtend file contains the
  113.        end of ctors marker and it must be last */
  114.     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  115.     KEEP (*(SORT(.ctors.*)))
  116.     KEEP (*(.ctors))
  117.   }
  118.   .dtors          :
  119.   {
  120.     KEEP (*crtbegin.o(.dtors))
  121.     KEEP (*crtbegin?.o(.dtors))
  122.     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  123.     KEEP (*(SORT(.dtors.*)))
  124.     KEEP (*(.dtors))
  125.   }
  126.   .jcr            : { KEEP (*(.jcr)) }
  127.   .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
  128.   .dynamic        : { *(.dynamic) }
  129.   .got            : { *(.got) }
  130.   . = DATA_SEGMENT_RELRO_END (24, .);
  131.   .got.plt        : { *(.got.plt) }
  132.   .data           :
  133.   {
  134.     *(.data .data.* .gnu.linkonce.d.*)
  135.     SORT(CONSTRUCTORS)
  136.   }
  137.   .data1          : { *(.data1) }
  138.   _edata = .; PROVIDE (edata = .);
  139.   __bss_start = .;
  140.   .bss            :
  141.   {
  142.    *(.dynbss)
  143.    *(.bss .bss.* .gnu.linkonce.b.*)
  144.    *(COMMON)
  145.    /* Align here to ensure that the .bss section occupies space up to
  146.       _end.  Align after .bss to ensure correct alignment even if the
  147.       .bss section disappears because there are no input sections.
  148.       FIXME: Why do we need it? When there is no .bss section, we don't
  149.       pad the .data section.  */
  150.    . = ALIGN(. != 0 ? 64 / 8 : 1);
  151.   }
  152.   .lbss   :
  153.   {
  154.     *(.dynlbss)
  155.     *(.lbss .lbss.* .gnu.linkonce.lb.*)
  156.     *(LARGE_COMMON)
  157.   }
  158.   . = ALIGN(64 / 8);
  159.   .lrodata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
  160.   {
  161.     *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
  162.   }
  163.   .ldata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
  164.   {
  165.     *(.ldata .ldata.* .gnu.linkonce.l.*)
  166.     . = ALIGN(. != 0 ? 64 / 8 : 1);
  167.   }
  168.   . = ALIGN(64 / 8);
  169.   _end = .; PROVIDE (end = .);
  170.   . = DATA_SEGMENT_END (.);
  171.   /* Stabs debugging sections.  */
  172.   .stab          0 : { *(.stab) }
  173.   .stabstr       0 : { *(.stabstr) }
  174.   .stab.excl     0 : { *(.stab.excl) }
  175.   .stab.exclstr  0 : { *(.stab.exclstr) }
  176.   .stab.index    0 : { *(.stab.index) }
  177.   .stab.indexstr 0 : { *(.stab.indexstr) }
  178.   .comment       0 : { *(.comment) }
  179.   /* DWARF debug sections.
  180.      Symbols in the DWARF debugging sections are relative to the beginning
  181.      of the section so we begin them at 0.  */
  182.   /* DWARF 1 */
  183.   .debug          0 : { *(.debug) }
  184.   .line           0 : { *(.line) }
  185.   /* GNU DWARF 1 extensions */
  186.   .debug_srcinfo  0 : { *(.debug_srcinfo) }
  187.   .debug_sfnames  0 : { *(.debug_sfnames) }
  188.   /* DWARF 1.1 and DWARF 2 */
  189.   .debug_aranges  0 : { *(.debug_aranges) }
  190.   .debug_pubnames 0 : { *(.debug_pubnames) }
  191.   /* DWARF 2 */
  192.   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  193.   .debug_abbrev   0 : { *(.debug_abbrev) }
  194.   .debug_line     0 : { *(.debug_line) }
  195.   .debug_frame    0 : { *(.debug_frame) }
  196.   .debug_str      0 : { *(.debug_str) }
  197.   .debug_loc      0 : { *(.debug_loc) }
  198.   .debug_macinfo  0 : { *(.debug_macinfo) }
  199.   /* SGI/MIPS DWARF 2 extensions */
  200.   .debug_weaknames 0 : { *(.debug_weaknames) }
  201.   .debug_funcnames 0 : { *(.debug_funcnames) }
  202.   .debug_typenames 0 : { *(.debug_typenames) }
  203.   .debug_varnames  0 : { *(.debug_varnames) }
  204.   /* DWARF 3 */
  205.   .debug_pubtypes 0 : { *(.debug_pubtypes) }
  206.   .debug_ranges   0 : { *(.debug_ranges) }
  207.   .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  208.   /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
  209. }
  210.